package com.geoboard.fragments;

import java.util.ArrayList;

import android.app.Activity;
import android.os.Bundle;
import android.support.v4.app.ListFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.geoboard.ActivityInterface;
import com.geoboard.R;
import com.geoboard.entity.Post;
import com.geoboard.service.ListAdapterPosts;

public class PostsTextFrag extends ListFragment{
	
	/**** Members **************************************************/
	
	/**** Methods **************************************************/
	public void setPosts(ArrayList<Post> posts){
		this.setListAdapter(new ListAdapterPosts(posts, getActivity()));
	}

	/**** Android Callback Methods *********************************/
	@Override
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		
		ArrayList<Post> p = ((ActivityInterface)getActivity()).getMapFrag().getVisiblePosts();
		if(p != null){
			setPosts(p);
		}
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState){
		
		return inflater.inflate(R.layout.frag_posts_text, container, false);		
	}
	
	@Override
	public void onAttach(Activity activity){
		super.onAttach(activity);
	}
	
	@Override
	public void onActivityCreated (Bundle savedInstanceState){
		super.onActivityCreated(savedInstanceState);
		
		
	}
	
	@Override
	public void onViewStateRestored (Bundle savedInstanceState){
		super.onViewStateRestored(savedInstanceState);
	}
	
	@Override
	public void onStart(){
		super.onStart();	
		
	}
	
	@Override
	public void onResume(){
		super.onResume();		
		
	}
		
		
	
	@Override
	public void onPause(){
		super.onPause();	
		
			
	}
	
	@Override
	public void onStop(){
		super.onStop();
	}
	
	@Override
	public void onDestroyView(){
		super.onDestroyView();
		
		
	}
	
	@Override
	public void onDestroy(){
		super.onDestroy();
	}
	
	@Override 
	public void onDetach(){
		super.onDetach();
	}
	


}
